package com.njbw.design_pattern.struct.decorator;

/**
 * 测试方法
 *
 * @author 黄侯淳
 * @since JDK 1.8
 */
public class Main {

    public static void main(String[] args) {
        // 1.创建一个原始对象
        Component component = new ConcreteComponent();
        // 2.进行第一次装饰
        component = Decorator.newDecoratorInstance(DecoratorOne.class, component);
        // 3.进行第二次装饰
        component = Decorator.newDecoratorInstance(DecoratorTwo.class, component);

        component.operation();
    }
}
